<?php
/**
 * The template for displaying Author Archive pages.
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */

get_header();
get_sidebar(); ?>

<!--contnent-->
<?php
function printRole($id){
    $id = (int)$id;

    $roles= array(
        10 => 'Администратор',
        7 => 'Редактор',
        2 => 'Автор',
        1 => 'Участник',
        0 => 'Подписчик');
    echo array_key_exists($id, $roles) ? $roles[$id] : 'Неизвестно';
}


?>
<div class="contentColumn clearfix reseter">
      <div class="contentWrap clearfix">
    <?php if ( have_posts() ) the_post(); ?>
    <?php $author_url = esc_url(get_author_posts_url(get_the_author_meta( 'ID' ))); ?>

        <div class="user_profile">
          <div class="user_profile_header clearfix reseter">
            <a class="user_name" href="<?php echo $author_url ?>"><?php the_author(); ?></a>
            <div class="user_class"><?php printRole(get_the_author_meta('user_level')); ?></div>
          </div>
          <div class="user_details clearfix reseter">
            <div class="user-avatar">
              <div id="author-avatar" class='avatar'>
                <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 90 ) ); ?>
              </div>
            </div>
            <?php $descr = get_the_author_meta( 'description' ); ?>
            <?php if($descr) { ?>
                <div class="msg_till">
                  <div class="msg_content"><?php echo $descr; ?></div>
                </div>
            <?php } ?>
            <div class="user-details-list">
              <div class="row clearfix reseter"><span>Дата регистрации</span>
                <div><?php echo date("d.m.Y", strtotime(get_the_author_meta('user_registered')))?></div>
              </div>
              <div class="row clearfix reseter"><span>Регион</span>
                <div><br /></div>
              </div>
              <div class="row clearfix reseter"><span>Статьи</span>
                <div><a href=""><?php echo get_usernumposts(get_the_author_meta( 'ID' )); ?></a></div>
              </div>
              <div class="row clearfix reseter"><span>Комментарии</span>
                <div><a href=""><br /></a></div>
              </div>
              <div class="row clearfix reseter"><span>Рейтинг</span>
                <div><br /></div>
              </div>
            </div>
            <div class="sep">&nbsp;</div>
            <div class="contacts_list clearfix reseter"> <strong>Связаться</strong>
              <ul>
                <li><img src="<?php echo get_template_directory_uri()?>/assets/images/c_icq.png" alt="" /> <a href=""><?php echo get_the_author_meta('aim'); ?></a></li>
                <li><img src="<?php echo get_template_directory_uri()?>/assets/images/c_tw.png" alt="" /> <a href=""></a></li>
                <li><img src="<?php echo get_template_directory_uri()?>/assets/images/c_skype.png" alt="" /> <a href=""></a></li>
              </ul>
              <ul>
                <li><img src="<?php echo get_template_directory_uri()?>/assets/images/c_fb.png" alt="" /> <a href=""></a></li>
                <li><img src="<?php echo get_template_directory_uri()?>/assets/images/c_youtube.png" alt="" /> <a href=""></a></li>
                <li><img src="<?php echo get_template_directory_uri()?>/assets/images/c_msg.png" alt="" /> <a href=""></a></li>
              </ul>
              <ul>
                <li><img src="<?php echo get_template_directory_uri()?>/assets/images/c_vk.png" alt="" /> <a href=""></a></li>
                <li><img src="<?php echo get_template_directory_uri()?>/assets/images/c_phone.png" alt="" /></li>
                <li><img src="<?php echo get_template_directory_uri()?>/assets/images/c_note.png" alt="" /><a href=""></a></li>
              </ul>
            </div>
          </div>
        </div>

    <center>
        <script type="text/javascript"><!--
            google_ad_client = "ca-pub-9972282238403501";
            /* vmrf top */
            google_ad_slot = "4623534787";
            google_ad_width = 728;
            google_ad_height = 90;
        //-->
        </script>
        <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
    </center>

    <div class="subcolumns clearfix">
        <div class="news_list">
            <?php
                rewind_posts();
                get_template_part( 'loop', 'list' );
                kriesi_pagination();
            ?>
       </div>
    </div>
</div>
</div>

<?php get_footer(); ?>
